﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;

namespace CodeScrapWindow
{
	internal sealed class StatusMessage
	{
		private StatusMessageType _messageType;
		private string _message;

		/// <summary>
		/// Gets or sets the type of the message.
		/// </summary>
		/// <value>The type of the message.</value>
		public StatusMessageType MessageType
		{
			get
			{
				return _messageType;
			}
		}

		/// <summary>
		/// Gets the color.
		/// </summary>
		/// <value>The color.</value>
		public Color Color
		{
			get
			{
				switch (this.MessageType)
				{
					case StatusMessageType.General:
					{
						return Colors.Black;
					}
					case StatusMessageType.Warning:
					{
						return Colors.Orange;
					}
					case StatusMessageType.Error:
					{
						return Colors.Red;
					}
					default:
					{
						throw new NotSupportedException(string.Format("Invalid status message type: {0}", this.MessageType));
					}
				}
			}
		}

		/// <summary>
		/// Gets or sets the message.
		/// </summary>
		/// <value>The message.</value>
		public string Message
		{
			get
			{
				return _message;
			}
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="StatusMessage"/> class.
		/// </summary>
		/// <param name="messageType">Type of the message.</param>
		/// <param name="message">The message.</param>
		public StatusMessage(StatusMessageType messageType, string message)
		{
			_messageType = messageType;
			_message = message;
		}
	}
}
